<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="s" uri="http://www.springframework.org/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>驳回原因统计</title>
    <jsp:include page="../../head.jsp"/>
    <script type="text/javascript">
        var formSetting = {
            title: "驳回原因统计",
            module: 'query',
            columns: [
                {
                    name: "business_Id",
                    label: "驳回业务编码"
                }, {
                    name: "initiator.u_name",
                    label: "申请人"
                }, {
                    name: "acceptor.u_name",
                    label: "处理人"
                }, {
                    name: "T_BIZ_DECLA_REJECT_RECORD.initiated_Time",
                    label: "申请时间从",
                    type: 'date',
                    op: 'ge'
                }, {
                    name: "T_BIZ_DECLA_REJECT_RECORD.initiated_Time",
                    label: "申请时间至",
                    type: 'date',
                    op: 'le'
                }, {
                    name: "T_BIZ_DECLA_REJECT_RECORD.init_Remark",
                    label: "驳回说明"
                }, {
                    name: "T_BIZ_DECLA_REJECT_RECORD.accepted_Time",
                    label: "处理时间从",
                    type: 'date',
                    op: 'ge'
                }, {
                    name: "T_BIZ_DECLA_REJECT_RECORD.accepted_Time",
                    label: "处理时间至",
                    type: 'date',
                    op: 'le'
                }, {
                    name: "T_GEN_DICTIONARY.ID",
                    label: "驳回原因",
                    type: "dropdown",
                    dropdownType: "ajax",
                    url: "/api/dictionary/getJsonByCodes?codes=" + encodeURI(
                        "{'codes':['reject_apply_reason']}"),
                    op: "eq",
                    minLength: 0,
                    success: function (data) {
                        var array = [];
                        for (var i = 0; i < data.content.length; i++) {
                            var contentData = data.content[i];
                            for (var ky in contentData) {
                                var sdata = contentData[ky];
                                $.each(sdata, function (i, n) {
                                    array.push([n["dtName"], n["dtId"]]);
                                });
                            }
                        }
                        return array;
                    }
                }],
            buttons: {
                custom: [{
                    id: "expbtn",
                    value: "导出报表",
                    click: function () {
                        var whereCase = assembleWhereCase(formSetting.columns);
                        jw.dialog({
                                      iframe: 'http://219.130.222.62:7080/report/ReportServer?reportlet=gtimp_test/rejectStatistics.cpt&whereCase='
                                              + whereCase,
                                      title: "驳回统计",
                                      iframeFetchTitle: false,
                                      width: 800,
                                      height: 800
                                  });
                    }
                },]
            },
            grid: {
                id: "gridTable",
                title: "查询结果",
                url: "rejectStatistics/query",
                dataType: "application/json",
                colModel: [{
                    index: "initiator.u_name",
                    name: "initiatorName",
                    label: "申请人"
                }, {
                    index: "acceptor.u_name",
                    name: "acceptorName",
                    label: "处理人"
                }, {
                    index: "T_BIZ_DECLA_REJECT_RECORD.initiated_Time",
                    name: "initiatedTime",
                    label: "申请时间"
                }, {
                    index: "T_BIZ_DECLA_REJECT_RECORD.accepted_Time",
                    name: "acceptedTime",
                    label: "处理时间"
                }, {
                    index: "business_Id",
                    name: "declaration.businessId",
                    label: "驳回业务编码"
                }, {
                    index: "T_GEN_DICTIONARY.DICTIONARY_NAME",
                    name: "rejectReason",
                    label: "驳回原因"
                }, {
                    index: "T_BIZ_DECLA_REJECT_RECORD.init_Remark",
                    name: "initRemark",
                    label: "驳回说明"
                }]
            }
        };
        $(document).ready(function () {
            $("#table").mrdForm(formSetting);
        });
    </script>
</head>
<body>
<div id="table"></div>
</body>
</html>
